package pub.cleangao.mybatis.config;

import pub.cleangao.common.util.Resources;
import java.io.IOException;
import java.util.Properties;

public record Config() {

    private static final String configProperties = "mybatis-enhance.properties";


    private static Properties loadConfig() {
        try {
            return Resources.getResourceAsProperties(configProperties);
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

    public static EnhanceProperties loadMyBatisEnhanceConfig() {
        Properties properties = loadConfig();
        if (properties == null) {
            return null;
        }
        return new EnhanceProperties(properties);
    }

}
